package org.apache.jsp.view.prateleira;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import br.com.skpharma.vo.*;
import br.com.skpharma.dao.*;
import java.util.*;

public final class index_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();

  private static java.util.List _jspx_dependants;

  private javax.el.ExpressionFactory _el_expressionfactory;
  private org.apache.AnnotationProcessor _jsp_annotationprocessor;

  public Object getDependants() {
    return _jspx_dependants;
  }

  public void _jspInit() {
    _el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
    _jsp_annotationprocessor = (org.apache.AnnotationProcessor) getServletConfig().getServletContext().getAttribute(org.apache.AnnotationProcessor.class.getName());
  }

  public void _jspDestroy() {
  }

  public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {

    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;


    try {
      response.setContentType("text/html; charset=ISO-8859-1");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\r\n");
      out.write("\r\n");
      out.write("<html>\r\n");
      out.write("<head>\r\n");
      out.write("<title></title>\r\n");
      out.write("<link href=\"../css/css.css\" rel=\"stylesheet\" type=\"text/css\">\r\n");
      out.write("</head>\r\n");
      out.write("\r\n");
      out.write("<body>\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("<p align=\"center\">Produtos Prateleira Cadastrados</p>\r\n");
      out.write("\r\n");
      out.write("<p align=\"right\">\r\n");
      out.write("<input type=\"button\" name=\"inserir\" style=\"font-size:10px\" value=\"Inserir Produtos Prateleira\" onClick=\"window.location.href='inserir.jsp'\"></p>\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("<table border=\"1\" width=\"100%\" style=\"font-size:9px\">\r\n");
      out.write("  <tr>\r\n");
      out.write("  \t<td width=\"3%\"><strong>Cód:</strong></td>\r\n");
      out.write("    <td width=\"15%\"><strong>Modelo:</strong></td>    \r\n");
      out.write("    <td width=\"7%\"><strong>Marca:</strong></td>\r\n");
      out.write("    <td width=\"7%\"><strong>Quantidade:</strong></td>\r\n");
      out.write("    <td width=\"7%\"><strong>Preço:</strong></td>\r\n");
      out.write("    <td width=\"7%\"><strong>Conteúdo:</strong></td>\r\n");
      out.write("    <td width=\"7%\"><strong>Tipo:</strong></td>\r\n");
      out.write("  </tr>\r\n");
      out.write("\r\n");

DAOPrateleira daoPrateleira = new DAOPrateleira();
ArrayList lista = new ArrayList();
lista = daoPrateleira.obterLista();		
for (int i = 0; i<lista.size(); i++){
	

      out.write("\r\n");
      out.write("  \t\t<tr>\r\n");
      out.write("  \t\t\t<td width=\"3%\">");
      out.print(((PrateleiraVO)lista.get(i)).getCod());
      out.write("</td>\r\n");
      out.write("\t\t    <td width=\"15%\"><a href=\"alterar.jsp?cod_prat=");
      out.print(((PrateleiraVO)lista.get(i)).getCod());
      out.write('"');
      out.write('>');
      out.write(' ');
      out.print(((PrateleiraVO)lista.get(i)).getModeloVO().getDs());
      out.write("</a></td>\r\n");
      out.write("\t\t    <td width=\"7%\">");
      out.print(((PrateleiraVO)lista.get(i)).getModeloVO().getMarcaVO().getDs());
      out.write("</td>\r\n");
      out.write("\t\t    <td width=\"7%\">");
      out.print(((PrateleiraVO)lista.get(i)).getQtde());
      out.write("</td>\r\n");
      out.write("\t\t    <td width=\"7%\">");
      out.print(((PrateleiraVO)lista.get(i)).getPreco());
      out.write("</td>\r\n");
      out.write("\t\t    <td width=\"7%\">");
      out.print(((PrateleiraVO)lista.get(i)).getConteudo());
      out.write("</td>\r\n");
      out.write("\t\t    <td width=\"7%\">");
      out.print(((PrateleiraVO)lista.get(i)).getTipoVO().getDs());
      out.write("</td>\r\n");
      out.write("\t\t</tr>\r\n");
		
}

      out.write("\r\n");
      out.write("\r\n");
      out.write("</table>\r\n");
      out.write("\r\n");
      out.write("</body>\r\n");
      out.write("</html>\r\n");
      out.write("\r\n");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          try { out.clearBuffer(); } catch (java.io.IOException e) {}
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}
